package com.zxl.thread;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Test {
    
    public static void main(String[] args) {
//        Thread t1 = new Thread(new Run1());
//        Thread t2 = new Thread(new Run2());
//        Thread t3 = new Thread(new Run3());
//        t1.start();
//        t2.start();
//        t3.start();
        ExecutorService ste = Executors.newSingleThreadExecutor();
        Run1 run1 = new Run1();
        Run2 run2 = new Run2();
        Run3 run3 = new Run3();
        for (int i = 0; i++ < 3;) {
            ste.submit(run1);
            ste.submit(run2);
            ste.submit(run3);
        }
        ste.shutdown();
    }
}
